import os
import re


def traverse_folder(folder_path):
    count = 1

    for root, dirs, files in os.walk(folder_path):
        for file in files:
            file_path = os.path.join(root, file)
            if (not file_path.endswith('.md')) or file_path.startswith('.'):
                findall = re.findall(r'\\\.[a-zA-Z]+', file_path)
                if not findall:
                    print(str(count) + file_path)
                    count += 1
        for dir in dirs:
            dir_path = os.path.join(root, dir)
            # print(dir_path)


# 指定要遍历的文件夹路径
folder_path = "D:\\Obsidian\\obsidianblog"

# 调用函数进行遍历
if __name__ == '__main__':
    traverse_folder(folder_path)
    # str = '8414D:\Obsidian\obsidianblog\工作\面试\集鑫T面试\简历\9\【测试工程师_杭州】周先生 10年 匹配度较高.pdf'
    # str = '4721D:\Obsidian\obsidianblog\.git\objects\98\f6a7ca227695a20d830a33c11a3e6ad3b602b9'
    # print(re.findall(r'\\\.[a-zA-Z]+', str))
